package com.example.administrator.ttphonehelper.util;


import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by gc on 2016/3/30.
 */
public class TimeUtil {
    //将日期格式化时间形式
    private static final SimpleDateFormat SIMPLE_TIME_FORMAT = new SimpleDateFormat("HH:mm:ss");
    //将日期格式化为日期形式
    private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy年MM月dd日");
    //将日期格式为星期
    private static final SimpleDateFormat SIMPLE_WEEK_FORMAT = new SimpleDateFormat("E");
    //格式化时间方法
    public static String date2DateStr(Date date)
    {
        return SIMPLE_DATE_FORMAT.format(date);
    }
    public static String date2TimeStr(Date date)
    {
        return SIMPLE_TIME_FORMAT.format(date);
    }
    public static String date2WeekStr(Date date)
    {
        return SIMPLE_WEEK_FORMAT.format(date);
    }
}
